<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition template="/templatePrincipal.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:rich="http://richfaces.org/rich">
    <ui:define name="conteudo">
        <script type="text/javascript">
            function limparCampos(){
                document.getElementById("fpUsuarios:itLogin").value = '';
                document.getElementById("fpUsuarios:itSenha").value = '';
                document.getElementById("fpUsuarios:itEmail").value = '';
                document.getElementById("fpUsuarios:itConta").value = '';
                document.getElementById("fpUsuarios:sorAcesso").value = '';
            }
        </script>
        <rich:spacer height="20"/>
        <center>
            <rich:messages layout="table"
                           errorClass="errorClass"
                           infoClass="infoClass"
                           warnClass="warnClass"
                           styleClass="painelMensagem"
                           ajaxRendered="true"/>
        </center>
        <rich:spacer height="10"/>
        <rich:panel switchType="client">
            <f:facet name="header">
                Alterar Senha
            </f:facet>

            <h:form id="fpUsuarios">
                <h:panelGrid cellspacing="2" cellpadding="2" columns="2" columnClasses="field-names, fields">

                    <h:outputLabel for="itSenhaNova" styleClass="required-black">
                        Senha Nova :
                    </h:outputLabel>
                    <h:inputSecret id="itSenhaNova" required="true" value="#{usuarioAction.paramSenhaNova}" style="width:150px;"/>

                </h:panelGrid>
                <br/>
                <h:commandLink id="clAlterar"
                               action="#{usuarioAction.alterarUsuario(identity.username)}"
                               styleClass="link dr-toolbar-ext rich-toolbar">
                    <h:graphicImage value="/resources/images/dialog-ok-old.png"/>
                    <h:outputText value="Alterar"/>
                </h:commandLink>

                <h:commandLink id="clLimpar"
                               immediate="true"
                               onclick="limparCampos()"
                               styleClass="link dr-toolbar-ext rich-toolbar">
                    <h:graphicImage value="/resources/images/edit-clear.png"/>
                    <h:outputText value="Limpar"/>
                </h:commandLink>
            </h:form>
        </rich:panel>
    </ui:define>
</ui:composition>